package com.core.reach.cloudhub.service;

import com.core.reach.cloudhub.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/4/1 9:54
 **/
@FeignClient(value = "seata-storage-service")
public interface StorageService {

    /**
     * 减库存
     * @param productId 产品id
     * @param count 库存
     * @return CommonResult
     */
    @PostMapping("storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId,
                          @RequestParam("count") Integer count);

}
